#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>

#define DRIVER_NAME "hello_kernel_platform_driver_device"

MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Bruce.zc_wang");

static void hello_kernel_platform_device_release(struct device *dev)
{
	printk("release hello_kernel_platform_device\n");
}

struct platform_device hello_kernel_device = {
	.name = DRIVER_NAME,
	.id = -1,
	.dev = {
		.release = hello_kernel_platform_device_release,
	}
};

static int hello_kernel_init(void)
{
	platform_device_register(&hello_kernel_device);
	return 0;
}

static void hello_kernel_exit(void)
{
	platform_device_unregister(&hello_kernel_device);
}

module_init(hello_kernel_init);
module_exit(hello_kernel_exit)
